package vn.com.demand.lux.view.labelprovider;

import org.eclipse.jface.viewers.ILabelProviderListener;
import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.swt.graphics.Image;

import vn.com.demand.lux.model.ServiceCardBean;
import vn.com.demand.util.DpUtils;

public class ServiceCardLabelProvider implements ITableLabelProvider {

	public Image getColumnImage(Object element, int columnIndex) {
		return null;
	}

	public String getColumnText(Object element, int columnIndex) {
		ServiceCardBean bean = (ServiceCardBean)element;
		switch (columnIndex) {
		case 0://Card number
			return DpUtils.trim(bean.getCardNumber());
		case 1://Resource ID
			return DpUtils.trim(bean.getResourceId());
		case 2://Fullname
			return DpUtils.trim(bean.getFullName());	
		case 3://Date
			return DpUtils.format(bean.getDate());
		case 4://From
			return DpUtils.trim(bean.getFromTime());
		case 5://To
			return DpUtils.trim(bean.getToTime());
		case 6://Customer code
			return DpUtils.trim(bean.getCustomerCode());
		case 7://Customer name
			return DpUtils.trim(bean.getCustomerName());
		case 8://Address
			return DpUtils.trim(bean.getAddress());	
		case 9://Contract number
			return DpUtils.trim(bean.getContractNumber());
		case 10://Service detail
			return DpUtils.trim(bean.getServiceDetail());
		case 11://Type
			return DpUtils.trim(bean.getType());	
		default:
			break;
		}
		return "";
	}

	public void addListener(ILabelProviderListener listener) {
	}

	public void dispose() {
	}

	public boolean isLabelProperty(Object element, String property) {
		return false;
	}

	public void removeListener(ILabelProviderListener listener) {
	}

}
